$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'digit2word'
require 'digit2word/commands'
require 'open3'

module Digit2wordHelpers
  def bin_path
    Digit2word.root.join('bin')
  end

  def run_with_argv(*arg_str)
    command = arg_str.compact.unshift("#{bin_path.to_s}/digit2word").join(' ')
    Open3.capture2(command).first
  end
end
